import 'package:flutter/material.dart';

/// @Author wywinstonwy
/// @Date 2022/6/9 3:33 下午
/// @Description: 

class WySnackBarPage extends StatefulWidget {
  const WySnackBarPage({Key? key}) : super(key: key);

  @override
  State<WySnackBarPage> createState() => _WySnackBarPageState();
}

class _WySnackBarPageState extends State<WySnackBarPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(child: GestureDetector(
        child: Text("屏幕底部消息"),
        onTap: (){
          print("点击底部");
          final snackBar = SnackBar(
              content: Text("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff这是snackbar"),
            backgroundColor: Colors.lightGreen,
            action: SnackBarAction(label: "撤销", onPressed: () {  },

            ),
            duration: Duration(minutes: 1),

          );
          ScaffoldMessenger.of(context).showSnackBar(snackBar);

        },
      ),),
    );
  }
}
